package com.cndw.kungfu.model.task;

import java.util.HashSet;
import java.util.Set;

import com.cndw.kungfu.domain.Task;

public class DartTask {

	private long playerId;
	
	private int fails;
	
	private Set<Long> targets;
	
	private Task task;
	
	private int npcId;
	
	public DartTask(Task task,int npcId){
		this.task = task;
		playerId = task.getPlayerId();
		this.npcId = npcId;
	}

	public Task getTask() {
		return task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	public long getPlayerId() {
		return playerId;
	}

	public void setPlayerId(long playerId) {
		this.playerId = playerId;
	}

	public Set<Long> getTargets() {
		return targets;
	}

	public void setTargets(Set<Long> targets) {
		this.targets = targets;
	}

	public int getNpcId() {
		return npcId;
	}

	public void setNpcId(int npcId) {
		this.npcId = npcId;
	}

	public int getFails() {
		return fails;
	}

	public void setFails(int fails) {
		this.fails = fails;
	}
	
	public synchronized void addTarget(long playerId){
		if (targets == null) {
			targets = new HashSet<Long>();
		}
		targets.add(playerId);
	}
	
	
	
}
